package com.atguigu.guli.service.edu.feign;

import com.atguigu.guli.common.base.result.R;
import com.atguigu.guli.service.edu.feign.fallback.OssFileServiceFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @className: OssFileService
 * @description: 远程调用接口
 * @date: 2020/11/29
 * @author: cakin
 */
@Service
@FeignClient(value = "service-oss", fallback = OssFileServiceFallBack.class)
public interface OssFileService {
    /**
     * 功能描述：远程调用OSS 服务接口
     *
     * @return R 返回给控制器的消息
     * @author cakin
     * @date 2020/11/29
     */
    @GetMapping("/admin/oss/file/test")
    R test();

    /**
     * 功能描述：远程调用OSS服务删除文件图像
     *
     * @param url 待删除的文件URL
     * @return R 返回给控制器的消息
     * @author cakin
     * @date 2020/11/29
     */
    @DeleteMapping("/admin/oss/file/remove")
    R removeFile(@RequestBody String url);
}
